package com.feicheng.controller;


import com.feicheng.base.result.Result;
import com.feicheng.model.IntoHeaderIntoItem;
import com.feicheng.service.ProviderWarehouseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 周启博
 * @since 2022-06-27
 */
@RestController
@RequestMapping("/into")
public class IntoHeaderController {

    @Autowired
    ProviderWarehouseController providerWarehouseController;

    /**
     * 入库查询详情
     * @param current 当前页
     * @param size 每页条数
     * @param intoHeaderId 入库头ID
     * @author yvan.yao
     * @return
     * @since 2022-07-04
     */
    @GetMapping("/detail/page")
    public Result selectintoheader(Integer intoHeaderId,
                                   @RequestParam(defaultValue = "1") Integer current,
                                   @RequestParam(defaultValue = "10") Integer size) {
        return Result.success(providerWarehouseController.getIntoHeader(intoHeaderId,current,size));
    }
    /**
     * 新增入库接口
     * @param intoHeaderIntoItem 入库信息
     * @author guihai.yu
     * @return
     */
    @PostMapping("/info")
    public Result insertInto(IntoHeaderIntoItem intoHeaderIntoItem) {
        return providerWarehouseController.insertInto(intoHeaderIntoItem);
    }

}

